import threading
import time
bar = threading.Barrier(3) #凑够3个人才会执行

def run():
    print('%s--start' % (threading.current_thread().name))
    time.sleep(1)#挺1秒

    bar.wait() #凑够 3 个人才会执行下面的代码
    print('%s--end' % (threading.current_thread().name))
if __name__ == '__main__':
    for i in range(6):
        threading.Thread(target=run).start()
